package StaticProxy;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: homechen
 * Date: 2024-03-24
 * Time: 14:00
 */

/**
 * 代理类
 */
public class UserServiceProxy implements UserService {
    // 代理对象
    private final UserService userService;

    public UserServiceProxy(UserService userService) {
        this.userService = userService;
    }

    @Override
    public void save(String username) {
        System.out.println("Before method execution!");
        userService.save(username); // 代理对象实现业务
        System.out.println("After method execution!");
    }
}
